home *** CD-ROM | disk | FTP | other *** search
/ PC-Blue - MS DOS Public Domain Library / PC-Blue MS-DOS Public Domain Library - NYACC.iso / vol076 / xmodtoex.for < prev   
Encoding:
Text File  |  1987-01-14  |  909 b   |  32 lines

  1.  
  2.     program xmodtoexe
  3. c  reconstruct an .EXE file from 128 byte records from XMODEM transfer
  4.     character line*256, input*128, output*128
  5.     integer blank
  6.     byte outrecord(512), in1(128), in2(128), in3(128), in4(128)
  7.     equivalence (outrecord,in1),(outrecord(129),in2)
  8.     equivalence (outrecord(257),in3),(outrecord(385),in4)
  9.  
  10.     call lib$get_foreign(line,'$_From  To: ',)
  11.  
  12.     blank=index(line,' ')
  13.     input=line( 1:blank )
  14.     output=line( blank:)
  15.  
  16.     open(6,file=input,status='OLD',readonly)
  17. c  note RECL is number of longwords for unformatted
  18.     open(7,file=output,status='NEW',carriagecontrol='NONE',
  19.     1           recl=128,recordtype='FIXED',form='unformatted')
  20.  
  21.   100    read(6,1,end=200) in1
  22.     read(6,1,end=300) in2
  23.     read(6,1,end=300) in3
  24.     read(6,1,end=300) in4
  25.     1    format(128a)
  26.     write(7) outrecord
  27.     goto 100
  28.  
  29.   300    print *,' EXETOXMOD-F-  4*x not equal number of records.'
  30.   200    call exit
  31.  
  32.       end
  33.